package com.spzx.product.controller;

import com.baomidou.mybatisplus.annotation.TableName;
import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.common.log.annotation.Log;
import com.spzx.common.log.enums.BusinessType;
import com.spzx.product.service.CategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.spzx.common.core.web.controller.BaseController;

/**
 * <p>
 * 商品分类 前端控制器
 * </p>
 *
 * @author lynn
 * @since 2025-03-12
 */
@RestController
@RequestMapping("/category")
@Tag(name = "商品分类")
public class CategoryController extends BaseController {

    @Autowired
    private CategoryService categoryService;

    /**
     * 获取商品分类下拉树列表
     */
    @Operation(summary = "查询商品分类",description = "获取商品分类下拉树列表")
    @GetMapping("/treeSelect/{id}")
    @Log(title = "商品分类管理", businessType = BusinessType.DELETE)
    public AjaxResult treeSelect(@Parameter(description = "分类id") @PathVariable Integer id){
        return success(categoryService.treeSelect(id));
    }

}
